package io.renren.runner;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

import io.renren.htby.utils.KafkaConsumeUtils;
import io.renren.kafka.consume.WebMonitorConsumer;

//@Component
public class WebMonitorConsumerRunner implements CommandLineRunner {

	private static Logger logger = LoggerFactory.getLogger(WebMonitorConsumerRunner.class);

	@Autowired
	private WebMonitorConsumer consumer;
	
	public void run(String... var1) throws Exception {
		logger.info("This will be execute when the project was started!");
		
		// 消费 监控系统的主题
		consumer.consume(KafkaConsumeUtils.monitor_topic);
		
	}
}
